﻿<%@ Page Language="C#" MasterPageFile="~/Admin/admin.master" AutoEventWireup="true"
    EnableEventValidation="false" CodeFile="JournalVoucher.aspx.cs" Inherits="JournalPage"
    Title="Journal Voucher List" %>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" runat="Server">
    JournalVoucher List</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <data:GridViewSearchPanel ID="GridViewSearchPanel1" runat="server" GridViewControlID="GridView1"
        PersistenceMethod="Session" />
    <br />
    <data:EntityGridView ID="GridView1" runat="server" AutoGenerateColumns="False" OnSelectedIndexChanged="GridView1_SelectedIndexChanged"
        DataSourceID="JournalVoucherDataSource" DataKeyNames="JournalVoucherId" AllowMultiColumnSorting="false"
        DefaultSortColumnName="JournalVoucherDate" DefaultSortDirection="Descending"
        ExcelExportFileName="Export_JournalVoucher.xls" AllowPaging="True">
        <Columns>
            <asp:TemplateField>
                <HeaderTemplate>
                    <input type="checkbox" class="checkall" />
                </HeaderTemplate>
                <ItemTemplate>
                    <asp:CheckBox runat="server" ID="cb_Check" /></ItemTemplate>
            </asp:TemplateField>
            <asp:CommandField ShowSelectButton="True" ShowEditButton="False" />
            <asp:TemplateField HeaderText="Status">
                <ItemTemplate>
                    <a href='<%#"ReportJournalVoucher.aspx?JournalVoucherId=" + Eval("JournalVoucherId") %>'>
                        <span class='<%# GetClass(Eval("JournalVoucherId").ToString()) %>'>
                            <%# GetStatus(Eval("JournalVoucherId").ToString()) %></span> </a>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:BoundField DataField="JournalVoucherId" HeaderText="JournalVoucher Id" SortExpression="[JournalVoucherID]"
                ReadOnly="True" />
            <asp:BoundField DataField="JournalVoucherDate" DataFormatString="{0:d}" HtmlEncode="False"
                HeaderText="JournalVoucher Date" SortExpression="[JournalVoucherDate]" />
            <data:HyperLinkField HeaderText="JournalVoucher Type Id" DataNavigateUrlFormatString="JournalVoucherTypeEdit.aspx?JournalVoucherTypeId={0}"
                DataNavigateUrlFields="JournalVoucherTypeId" DataContainer="JournalVoucherTypeIdSource"
                DataTextField="Description" />
            <asp:BoundField DataField="Description" HeaderText="Description" SortExpression="[Description]" />
            <asp:BoundField DataField="ExchangeRate" HeaderText="Exchange Rate" SortExpression="[ExchangeRate]" />
            <asp:BoundField DataField="PreparedBy" HeaderText="Prepared By" SortExpression="[PreparedBy]" />
            <asp:BoundField DataField="ApprovalBy" HeaderText="Approval By" SortExpression="[ApprovalBy]" />
            <asp:BoundField DataField="ExportedDate" DataFormatString="{0:d}" HtmlEncode="False"
                HeaderText="Export Date" SortExpression="[ExportedDate]" />
            <data:BoundRadioButtonField DataField="IsVoid" HeaderText="Is Void" SortExpression="[IsVoid]" />
            <data:BoundRadioButtonField DataField="IsCompleted" HeaderText="Is Completed" SortExpression="[IsCompleted]" />
        </Columns>
        <EmptyDataTemplate>
            <b>No JournalVoucher Found!</b>
        </EmptyDataTemplate>
    </data:EntityGridView>
    <br />
    <data:EntityDropDownList runat="server" CssClass="text-input" ID="ddlAction">
        <asp:ListItem Text="Choose an action ..."></asp:ListItem>
        <asp:ListItem Text="Print" Value="Print"></asp:ListItem>
        <asp:ListItem Text="Close Voucher" Value="Close"></asp:ListItem>
    </data:EntityDropDownList>
    <asp:Button runat="server" ID="btnApply" Text="Apply to selected" CssClass="button"
        OnClick="btnApply_Click" />
    <br />
    <br />
    <asp:Button runat="server" ID="btnJournalVoucher" OnClientClick="javascript:location.href='JournalVoucherEdit.aspx'; return false;"
        Text="Add New" CssClass="button"></asp:Button>
    <data:JournalVoucherDataSource ID="JournalVoucherDataSource" runat="server" SelectMethod="GetPaged"
        EnablePaging="True" EnableSorting="True" EnableDeepLoad="True">
        <DeepLoadProperties Method="IncludeChildren" Recursive="False">
            <Types>
                <data:JournalVoucherProperty Name="JournalVoucherType" />
                <%--<data:JournalVoucherProperty Name="JournalVoucherDetailCollection" />--%>
            </Types>
        </DeepLoadProperties>
        <Parameters>
            <data:CustomParameter Name="WhereClause" Value="" ConvertEmptyStringToNull="false" />
            <data:CustomParameter Name="OrderByClause" Value="" ConvertEmptyStringToNull="false" />
            <asp:ControlParameter Name="PageIndex" ControlID="GridView1" PropertyName="PageIndex"
                Type="Int32" />
            <asp:ControlParameter Name="PageSize" ControlID="GridView1" PropertyName="PageSize"
                Type="Int32" />
            <data:CustomParameter Name="RecordCount" Value="0" Type="Int32" />
        </Parameters>
    </data:JournalVoucherDataSource>
</asp:Content>
